package com.jacken.mars.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.jacken.mars.entity.base.BasePageRequest;
import com.jacken.mars.entity.SysUser;

/**
 * 持久层
 *
 * @Author wq
 * @Date 2020-12-15
 **/
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {

    /**
     * 分页
     *
     * @param page  page
     * @param query query
     * @return IPage<SysUser>
     */
    IPage<SysUser> findByQuery(IPage<SysUser> page, @Param("query") BasePageRequest query);

    /**
     * 查询用户根据电话号码
     *
     * @param mobile mobile
     * @return SysUser
     */
    SysUser selectUserMobile(@Param("mobile") String mobile);

    /**
     * 查询系统用户名称
     * @param sysUserId
     * @return
     */
    String selectNickname(@Param("sysUserId") Integer sysUserId);

    /**
     * 查询用户
     * @param mobile
     * @return
     */
    SysUser selectUserByMobile(@Param("mobile") String mobile);
}
